<html>

	<head>
		<meta charset="utf-8">
		<title></title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<!--标准mui.css-->
		<link rel="stylesheet" href="../css/mui.min.css">
		<!--App自定义的css-->
		<style type="text/css">
			.cameraImg {
				width: 65px;
				height: 65px;
			}
			
			.showImg {
				width: 200px;
				height: 260px;
			}
		</style>

	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">发送短信</h1>
		</header>
		<div class="mui-content">
			<div class="mui-content-padded">
				<p>该功能可调用原生发送短信的功能，可以跳转到短信编辑页面，联系人，短信内容会根据js传入的参数自动填充</p>
				<form class="mui-input-group">
					<div class="mui-input-row">
						<label>手机号</label>
						<input id="telNum" type="text" class="mui-input-clear" placeholder="请输入联系人手机号">
					</div>
				</form>
				<div class="mui-input-row" style="margin: 10px 5px;">
					<textarea id="smsBody" rows="5" placeholder="请输入短信内容..."></textarea>
				</div>
				<div class="mui-content-padded">
					<button type="button" class="mui-btn mui-btn-primary mui-btn-block" onclick="sendMessage()">发送</button>
				</div>
			</div>
		</div>
	</body>
	<script src="../js/mui.min.js"></script>
	<script src="../bridge.js"></script>
	<script src="../plugins/zepto.min.js"></script>
	<script>
		mui.init({
			swipeBack: false
		});
		/**
		 * 发送短信
		 * @param {Object} params(参数) callback（回调函数，返回data ）
		 */
		function sendMessage() {
			var telNum = $("#telNum").val();
			var smsBody = $("#smsBody").val();
			if(!(telNum && smsBody)) {
				mui.toast("请输入短信内容或者联系人号码！");
				return;
			}
			Mplat.shortMessage({
				params: {
					"telNum": telNum,
					"smsBody": smsBody
				}
			});
		}
	</script>

</html>